package model;

import battleship.ConfigureGame;
import exceptions.MissException;

public class UnArmoredShip extends Ship 
{

	public UnArmoredShip(int n) 
	{
		super(n);
	}
	
	@Override
	public int determineShipStatus(int id) throws MissException
	{
		if(id == ConfigureGame.MINDSWEEPER_ID || id == ConfigureGame.SUBMARINE_ID - 3) //se verifica daca am lovit in cabina capitanului
		{
			int i;
			for(i=0;i<this.ship_nr_of_blocks;i++)
				this.components[i].playDead();
			System.out.println("SUNK! "+"Ship: "+ this.getClass().getName());
			this.notifyObservers();
			return ConfigureGame.SHIP_SUNK_CODE;
		}
		else
			return super.determineShipStatus(id);
	}
	
}
